package com.icez.designmode

import android.content.Context
import android.graphics.Color
import com.icez.banner_view.BannerViewAdapter
import com.icez.designmode.databinding.ItemBannerBinding

class BannerAdapter(layoutResId:Int,mData:ArrayList<String>):BannerViewAdapter<String,ItemBannerBinding>(layoutResId,mData) {
    override fun onBusinessOperation(
        context: Context,
        binding: ItemBannerBinding,
        position: Int,
        item: String?
    ) {
        if(position % 2 == 0){
            binding?.root?.setBackgroundColor(Color.RED)
        }else{
            binding?.root?.setBackgroundColor(Color.BLUE)
        }

        binding?.itemBannerTv?.text = position.toString()
    }

//    override fun getItemCount(): Int {
//        return Int.MAX_VALUE
//    }
}